#pragma once
#include "LogPrintBase.h"
#include "LogPrintMgr.hpp"


class LogWorker;
class LogWorkerImpl{
    friend class LogWorker;

public:
    LogWorkerImpl(LOG_LEVEL level,const char* file,const char* fun,int line,time_t cur);
    ~LogWorkerImpl();
   
    inline void _setLogInfo(LOG_LEVEL level,const char* file,const char* fun,int line,time_t cur){
        pos_.setFile(file);
        pos_.setLine(line);
        pos_.setFunc(fun);
        pos_.setTime(cur);
        level_=level;	
    }
    inline LOG_LEVEL          getLogLevel() const { return level_; }
	void                      pushLog();
	inline std::stringstream& appendData() { return log_buffer_; }
    
    
private:
    std::stringstream log_buffer_;
    bool        open_;
    LogPos      pos_;
	LOG_LEVEL   level_;
};



